<template>
  <div class="resStatistical">
    <div style=" margin-left: 120px;">
      <h2 style="text-align: left;">营销管理/一体机抽奖</h2>
    </div>
    <div style="width: 100%; margin-bottom: 40px;"><hr /></div>
    <el-tabs
      style="padding-left: 20px;padding-right: 20px"
      v-model="activeName"
      type="card"
      @tab-click="handleClick"
    >
      <el-tab-pane label="中奖纪录" name="winRecord" style="300px"></el-tab-pane>
      <el-tab-pane label="抽奖设置" name="lotterySet" style="300px"></el-tab-pane>
    </el-tabs>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeName: "",
    };
  },
  methods: {
    handleClick(tab, event) {
      if (this.activeName == "winRecord") {
        this.$router.push({
          path: "/onemachinelottery/winrecord",
        });
      } else if(this.activeName == "lotterySet"){
        this.$router.push({
          path: "/onemachinelottery/lotterySet",
        });
      }
    },
  },
  created() {
    if(this.$router.history.current.path=="/onemachinelottery/winrecord"){
      this.activeName="winRecord"
    }else{
       this.activeName="lotterySet"
    }
  },
};
</script>

<style scoped></style>
